<div class="formTitle formTitle<%= hash[:structure]["name"].capitalize %>"><%= t("#{hash[:structure]["name"]}.title") %></div>
<%= form_for(hash[:entity], :url => hash[:url], :html => { :multipart => true, :method => hash[:method]}) do |f| %>
  <%= error_messages_for hash[:entity] %>
  <% hash[:structure]["sections"].each do |section| %>
    <%= round_corners({:classname => "formsection", :bottomleft => "formSectionGeneral formSection#{section["name"].capitalize}"}) do %>
      <div class="formSectionHeader formSectionHeader<%= section["name"].capitalize %>">
        <%= raw t("#{hash[:structure]["name"]}.section.#{section["name"]}") %>
      </div>
      <div class="formSectionBody formSectionBody<%= section["name"].capitalize %>">

        <% section["fields"].each do |field| %>
          <% admin = @current_roles.include?("admin") %>
          <% show_for = field["show_for"] && @current_roles.include?("show_for") %>
          <% not_show = field["not_show"] && @page["not_show"] == field["not_show"] %>
          <% if admin || show_for || (!field["show_for"] && !show_for && !not_show) %>
            <%= render :partial => "shared/field", :locals => {:hash => {:field => field,
                :form_name => hash[:structure]["name"],:section_name => section["name"], :form => f, :entity => hash[:entity]}} %>
          <% end %>
        <% end %>
      </div>
    <% end %>
  <% end %>
  <a href="#" class="submitButton submitButton<%= hash[:structure]["name"].capitalize %>" onclick="$('form').submit();return false;"><%= t("#{@page["name"]}.submit") %></a>
  <%#= submit_tag t("#{hash[:structure]["name"]}.submit"), :class => "submitButton submitButton#{hash[:structure]["name"].capitalize}" %>
<% end %>